<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="include/peizhi.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="${ctx}">
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
        
        <title>后台管理中心</title> 
		<link rel="stylesheet" href="${ctx}/css/pintuer.css" /> 
		<link rel="stylesheet" href="${ctx}/css/admin.css" /> 
        <script type="text/javascript" src="${ctx}/js/jquery-1.9.1.min.js"></script>
    </head>
  	<body style="background-color:#f2f9fd;"> 
	  <jsp:include page="include/header.jsp" flush="true"/>
  <div class="admin"> 
  	<div class="panel admin-panel">
	  <div class="panel-head"><strong><span class="icon-key"></span> 修改会员密码</strong></div>
	  <div class="body-content">
	    <form method="post" class="form-x" id='formAction' action="">
	      <div class="form-group">
	        <div class="label">
	          <label for="sitename">管理员帐号：</label>
	        </div>
	        <div class="field">
	          <label style="line-height:33px;">
	           <input type="text" class="input w50" id="mpass" name="name" size="50" value="" placeholder="请输入管理员姓名" />
	          </label>
	        </div>
	      </div>      
	      <div class="form-group">
	        <div class="label">
	          <label for="sitename">原始密码：</label>
	        </div>
	        <div class="field">
	          <input type="password" class="input w50" id="mpass" name="password" size="50" placeholder="请输入原始密码" />       
	        </div>
	      </div>      
	      <div class="form-group">
	        <div class="label">
	          <label for="sitename">新密码：</label>
	        </div>
	        <div class="field">
	          <input type="password" class="input w50" name="newpassword" size="50" placeholder="请输入新密码" />         
	        </div>
	      </div>
	      <div class="form-group">
	        <div class="label">
	          <label for="sitename">确认新密码：</label>
	        </div>
	        <div class="field">
	          <input type="password" class="input w50" name="newpasswords" size="50" placeholder="请再次输入新密码" />          
	        </div>
	      </div>
	      
	      <div class="form-group">
	        <div class="label">
	          <label></label>
	        </div>
	        <div class="field">
	          <button class="button bg-main icon-check-square-o" id='formSubmit' type="button"> 提交</button>   
	        </div>
	      </div>      
	    </form>
	  </div>
	</div>
  </div> 
 </body>
 <script type="text/javascript">
 	$("#formSubmit").click(function(){
 		//alert("sssss");
 		$.ajax({
 			url:"${ctx}/password/update",
 			type:"post",
 			data:$("#formAction").serialize(),
 			success:function(data){
 				if(data=='0'){
 					alert("保存成功,请重新登陆");
 					window.location.href="${ctx}/login/outUser";
 				}else if(data=='1'){
 					alert("原密码不正确");
 				}else if(data=='2'){
 					alert("新老密码相同");
 				}else if(data=='3'){
 					alert("两次新密码不相符");
 				}else if(data=='4'){
 					alert("原姓名密码不可为空");
 				}else if(data=='5'){
 					alert("原姓名不可为空");
 				}else if(data=='6'){
 					alert("原密码不可为空");
 				}else if(data=='7'){
 					alert("新密码不可为空");
 				}else if(data=='8'){
 					alert("新重复密码密码不可为空");
 				}else if(data=='9'){
 					alert("账号异常请退出重新登录");
 				}else if(data=='9'){
 					alert("保存未成功请重新操作");
 				}
 			}
 		});
 	});
 </script>
</html>